home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / DEGREE.dxr / 00014.ls < prev    next >
Encoding:
Text File  |  1998-07-22  |  634 b   |  19 lines

  1. on enterFrame
  2.   set xCenter to ((the left of sprite 4 + the right of sprite 4) / 2) + 1
  3.   set yCenter to (the top of sprite 4 + the bottom of sprite 4) / 2
  4.   set radius to the width of sprite 4 / 2
  5.   set the trails of sprite 5 to 1
  6.   repeat with n = 0 to 720
  7.     if the mouseDown then
  8.       go("Start")
  9.       exit repeat
  10.     end if
  11.     set dy to float(radius) * float(sin((360 - n) * PI / 180.0))
  12.     set dx to float(radius) * float(cos(n * PI / 180.0))
  13.     drawLine(5, yCenter, xCenter, yCenter + dy, xCenter + dx)
  14.     set the foreColor of sprite 5 to random(250)
  15.     updateStage()
  16.   end repeat
  17.   set the trails of sprite 5 to 0
  18. end
  19.